#pragma once

#include "middle.h"
#include "../../include/IBtsDBSvr.h"

#include "MiddleBgsAux.h"
using namespace BGS;

#include "Packet_BGS66.h"
using namespace BGS66;

class CAuxDevice;

namespace BGS66
{
#ifdef __USE_BGS66__
class CMiddleBGS66: public CMiddleBgsAux
{
public:
    CMiddleBGS66(DWORD dwSocket, const string & strIP, CBuffer * pBuf, BYTE btDeviceID, BYTE btSubDevID, WORD wVersion);
    virtual ~CMiddleBGS66();
public:
    virtual void ProcessPacket(BYTE btCmd);
    bool SendCmd_BGS66_SetStep(DWORD dwSocket, const BTSCS::CCsPacket_BGS66_SetStep & CsPacket);
    void SendCmd_BGS66_SetStepResp();
    void SendCmd_BGS66_StartResp();
public:
    bool BGS66_CreateChannelTest(const BYTE btDeviceID, const BYTE btSubDevID, const vector<BYTE> & vcChlID, const vector<DWORD> & vcTestID);
    void BGS66_SaveStepToChannel(BTSDB::BGS66_Step & StepData);
public:
    virtual bool Set_BarCodeChannel(const BTSCS::CCsPacket_SendCellName &CsPacket);
    virtual bool Set_BarCodeChannelMB(const BTSCS::CCsPacket_SendCellNameMB &CsPacket);
    virtual bool Set_BarCodeAuxChannel(const BTSCS::CCsPacket_SendAuxCellName &CsPacket);
public:
    BTSDB::ATL_BarCode_InsertBarCode m_AtlBarCode;
    BTSDB::ChlBarCode m_ChlBarCode;
    BTSDB::CAuxChlBarCode m_AuxChlBarcode;

    BYTE m_btMBBarCodeFlag;
    void SaveBarCode(BGS::CPacket_StartResp* pResp);
    void SaveATLBarCode(BGS::CPacket_StartResp* pResp);
    void SaveMBBarCode(BGS::CPacket_StartResp* pResp);
    void SaveAuxBarCode(BGS::CPacket_StartResp* pResp);
};
#endif//__USE_BGS66__
};
